import java.util.Scanner;

/**
 * 【程序24】   
 * 题目：给一个不多于5位的正整数，要求：一、求它是几位数，二、逆序打印出各位数字。 
 */
public class test24 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入一个不多于五位的正整数：");
        int number = sc.nextInt();
        int sum = 0;
        System.out.print("将该正整数逆序输出为：");
        for (int i = 0; i < 5; i++) {
            int j = number % 10;
            System.out.print(j);
            number = number / 10;
            sum = sum + 1;
            if (number == 0)
                break;
        }
        System.out.println("\n该正整数为" + sum + "位数");
    }
}
